﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IGenericRepository.cs" company="">
//   Copyright (c) 2010/2011 All Right Reserved
// </copyright>
// <summary>
//   Base repository interface provides basic logic for data manipulation
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace iBuproModel.Repositories.Interfaces
{
    using System;
    using System.Linq;
    using System.Linq.Expressions;

    public interface IGenericRepository<T>
    {
        IQueryable<T> GetAll();
        IQueryable<T> GetAll(Expression<Func<T, bool>> filter);
        T GetSingle(Expression<Func<T, bool>> filter);
        T First(Expression<Func<T, bool>> filter);
        void Delete(Expression<Func<T, bool>> filter);
        void Delete(T entity);
        void Add(T entity);
        void Update(T entity);
        void SaveChanges();
        void DetachObject(object obj);
    }
}
